package com.caiyi.financial.nirvana.sms.swagger;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Created by Mario on 2017/9/25.
 * Swagger配置类
 */
@Configuration
@EnableSwagger2
@Profile({"dev"})
public class SwaggerConfig {

    @Bean
    public Docket createRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .enable(true)
                .apiInfo(new ApiInfoBuilder()
                        .title("短信平台-Admin")//大标题
                        .description("短信平台服务Admin项目.")//详细描述
                        .version("1.0.0")//版本
                        .build())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.caiyi.financial.nirvana.sms.controller"))
                .paths(PathSelectors.any())
                .build();
}
}
